const regeneratorRuntime=require('../../lib/runtime.js');
const app=getApp();
function getBeijingtime() {
  //获得当前运行环境时间
  var d = new Date();
  let currentDate = new Date();
  let tmpHours = currentDate.getHours();
  //算得时区
  var time_zone = -d.getTimezoneOffset() / 60;
  if (time_zone < 0) {
    time_zone = Math.abs(time_zone) + 8; currentDate.setHours(tmpHours + time_zone);
  } else {
    time_zone -= 8; currentDate.setHours(tmpHours - time_zone);
  }
  return currentDate;
}

Page({

  /**
   * 页面的初始数据
   */
  data: {
    giftList:null
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.getGiftList();
  },


  getGiftList(){
    wx.cloud.callFunction({
      name:'getGiftList'
    }).then(res=>{
      //console.log(res.result);
      let giftList=res.result.giftList;
      if(giftList&&giftList.length>0){
        this.setData({
          giftList
        })
      }
    })
  },
})